# vim: ts=4:sw=4:syntax=perl

use gri_secmgr qw(get_user_name);

sub mm_admin_portal_access_requests_options {
my ($portal,$repname,$repnum)=@_;

	my $user_name=get_user_name();
	my ($access_admin,$err)=$::GRI_FRONTEND->does_user_have_role($user_name,"access_admin");

	#################################################################
	# If the user is not in the "user_admin" then we don't create	#
	# any links...							#
	#################################################################
	if($access_admin==0) {
		my $s="
    <tr class=gri_row>
      <td class=gri_cell-disabled colspan=2>&nbsp; &nbsp; Show Access Requests Status Report</td>
    </tr>
    <tr class=gri_row>
      <td class=gri_cell-disabled colspan=2>&nbsp; &nbsp; Clean Completed Requests</td>
    </tr>";
		return $s;
	}
	#################################################################
	# We now need to generate links to the access admin reports	#
	# cleanups etc...						#
	#################################################################
	my $s="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Show Access Requests Status Report","access_admin_status_report","");
	$s.="
      </td>
    </tr>";
	my $a=string_to_hex("cleanup");
	$s.="
    <tr class=gri_row>
      <td colspan=2 class=gri_cell>&nbsp;&nbsp;";
	$s.=link_to_str("stdlink","Clean Completed Requests","form_access_admin_cleanup","action=$a");
	$s.="
      </td>
    </tr>";
	return $s;
}

1;
